package com.lkd.handler;

import com.lkd.business.MsgHandler;
import com.lkd.contract.SupplyContract;
import com.lkd.service.VendingMachineService;
import com.lkd.utils.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;


//接收补货消息
public class SupplyMsgHandler implements MsgHandler {


    @Autowired
    private VendingMachineService vmService;

    @Override
    public void process(String jsonMsg) throws IOException {
        SupplyContract supplyContract = JsonUtil.getByJson(jsonMsg, SupplyContract.class);
        vmService.supply(supplyContract);


    }
}
